<template>
  <div class="newsinfo-box">
    <h3 class="title">{{ newsInfo.title }}</h3>
    <p class="subtitle">
      <span>发表时间：{{newsInfo.add_time|initTime}}</span>
      <span>点击次数：{{newsInfo.click}}</span>
    </p>
    <hr>
    <div class="content" v-html="newsInfo.content"></div>
    <Comment :prent_id="'news_'+this.$route.params.id"/>
  </div>
</template>






<script>
import Comment from '../../components/comment.vue'
export default {
  data(){
    return {
      newsInfo:{}
    }
  },
  components:{
    Comment
  },
  async created(){
    let data=await this.ajax.get(`/api/newsInfo/${this.$route.params.id}`)
    this.newsInfo=data.data
  }
}
</script>








<style lang="less" scoped>
.newsinfo-box{
  padding: 0 10px 0 10px;
  .title{
    text-align: center;
    color: red;
    font-size: 16px;
  }
  .subtitle{
    display: flex;
    justify-content: space-between;
    color: blue;
  }
  .content{
    padding-top: 10px;
  }
}
</style>